Skip to content

feat: import remote types components - #20

Draft
vvnsrzn wants to merge 1 commit into
module-federation:mainfrom
vvnsrzn:feat/typesafe-remote-components
Draft

feat: import remote types components#20
vvnsrzn wants to merge 1 commit into
module-federation:mainfrom
vvnsrzn:feat/typesafe-remote-components

Conversation

@vvnsrzn

@vvnsrzn vvnsrzn commented Aug 10, 2026

Copy link
Copy Markdown

Hello,

Thank you for this plugin; it offers lots of interesting features.

However, I faced an issue while playing with remote components.

Indeed, I didn't have any type completions or type checking.

So I’m opening this PR, which imports the declarations and provides them to the host.

Screenshots:

image image

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@module-federation/nuxt@20

commit: 2d56466

${components
.map(
(component) =>
`${component.componentName}: typeof import("../../../${component.remoteName}/.nuxt/components.d.ts")["${component.exposedName}"];`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vvnsrzn for your help.
This path only works for sibling monorepo folders.
Let's instead use the module-federation/vite dts prop.

@vvnsrzn
vvnsrzn marked this pull request as draft August 10, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants